<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>

    <script src="./js/vue.js"></script>
    <script>
      // 1. 定义一个 三个 组件
      const zzzz = Vue.extend({
        template: `
            <div>我是 zzzz</div>
        `,
      });
      const xxxx = Vue.extend({
        template: `
            <div>
                我是 xxxx
                <zzzz></zzzz>    
            </div>
        `,
        components: {
          // 注册组件, 局部组件
          zzzz: zzzz,
        },
      });
      const yyyy = Vue.extend({
        template: `
            <div>
                我是 yyyy
                <xxxx></xxxx>    
            </div>
        `,
      });

      //   注册全局组件
      Vue.component("xxxx", xxxx);

      new Vue({
        el: "#app",
      });
    </script>
  </body>
</html>
